package com.music.pojo;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class SingleSong {
    private Integer mid;

    private String mname;

    private String source;

    private String pic;

    private Date publishTime;

    private String publishTimeStr;

    private Integer alid;

    private Integer sid;

    private String lyc;

    private Singer singer;

    private List<Category> categorys;

    private Album album;

    private List<Comment> comments;

    private Integer favoriteStatus;

    public String getPublishTimeStr() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        if (getPublishTime() != null) {
            return sdf.format(getPublishTime());
        } else {
            return "暂无发行日期";
        }
    }

    public void setPublishTimeStr(String publishTimeStr) {
        this.publishTimeStr = publishTimeStr;
    }

    public Integer getMid() {
        return mid;
    }

    public void setMid(Integer mid) {
        this.mid = mid;
    }

    public String getMname() {
        return mname;
    }

    public void setMname(String mname) {
        this.mname = mname == null ? null : mname.trim();
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source == null ? null : source.trim();
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic == null ? null : pic.trim();
    }

    public Date getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }

    public Integer getAlid() {
        return alid;
    }

    public void setAlid(Integer alid) {
        this.alid = alid;
    }

    public Integer getSid() {
        return sid;
    }

    public void setSid(Integer sid) {
        this.sid = sid;
    }

    public String getLyc() {
        return lyc;
    }

    public void setLyc(String lyc) {
        this.lyc = lyc == null ? null : lyc.trim();
    }

    public Singer getSinger() {
        return singer;
    }

    public void setSinger(Singer singer) {
        this.singer = singer;
    }

    public List<Category> getCategorys() {
        return categorys;
    }

    public void setCategorys(List<Category> categoryList) {
        this.categorys = categoryList;
    }

    public Album getAlbum() {
        return album;
    }

    public void setAlbum(Album album) {
        this.album = album;
    }

    public List<Comment> getComments() {
        return comments;
    }

    public void setComments(List<Comment> comments) {
        this.comments = comments;
    }

    public Integer getFavoriteStatus() {
        return favoriteStatus==null?0:favoriteStatus;
    }

    public void setFavoriteStatus(Integer isFavorite) {
        this.favoriteStatus = isFavorite;
    }
}